package com.ddwl.gate.service;

import com.ddwl.gate.dao.WechatPushRecordDao;
import com.ddwl.gate.model.WechatPushRecord;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.Instant;

/**
 * @Author hemiaojun
 * @Date 2021/6/9 17:06
 */
@Service
public class WechatPushRecordService {

    @Resource
    private WechatPushRecordDao wechatPushRecordDao;


    public void save(String toUser,String templateId,String message,Long errCode,String errMsg,Long msgId){
        WechatPushRecord wpr = new WechatPushRecord();
        wpr.setTouser(toUser);
        wpr.setTemplateId(templateId);
        wpr.setMessage(message);
        wpr.setPushTime(Instant.now());
        wpr.setErrcode(errCode);
        wpr.setErrmsg(errMsg);
        wpr.setMsgid(msgId);
        wechatPushRecordDao.insert(wpr);
    }


}
